﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UserProfile.aspx.cs" Inherits="sWarranty.WEB.UserProfile" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <link rel="stylesheet" type="text/css" href="../CSS/Table.css" />
    <link rel="stylesheet" type="text/css" href="../CSS/Menu.css" />
    <script src="../JS/jquery-1.8.2.js" type="text/javascript"></script>
    <link href="../CSS/notify.css" rel="stylesheet" type="text/css" />
    <script src="../JS/notify.js" type="text/javascript"></script>
    <script type="text/javascript">

        function CloseWindow() {
            window.close();
        }

        function SaveInfo() {
            var p1 = $('#txtNewpass1').val();
            var p2 = $('#txtNewpass2').val();
            var empNo = $('#<%=lblEmpNo.ClientID%>').html();
            if (p1 != p2) {
                alert('Please confirm your pass is same');
                return;
            }
            if (p1 == '') {
                alert('Please input password');
                return;
            }
            $('#imgLoadingabc').show();
            var options = {
                type: 'POST',
                url: 'WebService1.asmx/SaveInfo',
                data: '{empNo: "' + empNo + '", newpass: "' + p1 + '"}',
                contentType: 'application/json; charset=utf-8',
                dataType: 'json',
                success: function (msg) {
                    alert(msg.d);
                    $('#imgLoadingabc').hide();
                },
                error: function (msg) {
                    $('#imgLoadingabc').hide();
                    alert("Unknow Error: " + msg.d)
                }
            };
            $.ajax(options);
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ksdjfl" runat="server">
    </asp:ScriptManager>
    <div class="TitleCont">
        User Profile
    </div>
    <div class="Mid2">
        <div class="Search2" id="divInfoUser" runat="server">
            <table id="newspaper-b" summary="2007 Major IT Companies' Profit">
                <tbody>
                    <tr>
                        <td class="BackGround-gray">
                            Employee No
                        </td>
                        <td>
                            <asp:Label ID="lblEmpNo" runat="server"></asp:Label>
                        </td>
                        <td class="BackGround-gray" rowspan="2">
                            Avatar
                        </td>
                        <td rowspan="2">
                            <img src='../images/user-group-icon.png' width='56px' height='56px' />
                        </td>
                    </tr>
                    <tr>
                        <td class="BackGround-gray">
                            Email
                        </td>
                        <td>
                            <asp:Label ID="lblEmail" runat="server"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td class="BackGround-gray">
                            Full Name
                        </td>
                        <td>
                            <asp:Label ID="lblFullName" runat="server"></asp:Label>
                        </td>
                        <td class="BackGround-gray">
                            Grade
                        </td>
                        <td>
                            <asp:Label ID="lblGrade" runat="server"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td class="BackGround-gray">
                            Department
                        </td>
                        <td>
                            <asp:Label ID="lblDept" runat="server"></asp:Label>
                        </td>
                        <td class="BackGround-gray">
                            Position
                        </td>
                        <td>
                            <asp:Label ID="lblPosition" runat="server"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td class="BackGround-gray">
                            Authority
                        </td>
                        <td>
                            <asp:Label ID="lblAuthority" runat="server"></asp:Label>
                        </td>
                        <td class="BackGround-gray">
                            Region Data View
                        </td>
                        <td>
                            <asp:Label ID="lblUserRegion" runat="server"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td class="BackGround-gray">
                            New Pass:
                        </td>
                        <td>
                            <asp:TextBox ID="txtNewpass1" TextMode="Password" runat="server" ClientIDMode="Static"></asp:TextBox>
                        </td>
                        <td class="BackGround-gray">
                            Confirm:
                        </td>
                        <td>
                            <asp:TextBox ID="txtNewpass2" runat="server" TextMode="Password" ClientIDMode="Static"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4">
                            <asp:Button ID="btnClose" runat='server' Text="Close" Width="80px" CssClass="button Float-right" />
                            <input type="button" value="Change" style="width: 80px;" class="button Float-right"
                                onclick="changePass()" />
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
        <div class="Search2" id="divModifyUser" runat="server">
            <table id="newspaper-b" summary="2007 Major IT Companies' Profit">
                <tbody>
                    <tr>
                        <td class="BackGround-gray">
                            Employee No
                        </td>
                        <td>
                            <asp:Label ID="lblEmpNo2" runat="server"></asp:Label>
                        </td>
                        <td class="BackGround-gray" rowspan="2">
                            Avatar</td>
                        <td rowspan="2">
                            <img src='../images/user-group-icon.png' width='56px' height='56px' />
                        </td>
                    </tr>
                    <tr>
                        <td class="BackGround-gray">
                            Email
                        </td>
                        <td>
                            <asp:Label ID="lblEmail2" runat="server"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td class="BackGround-gray">
                            Full Name
                        </td>
                        <td>
                            <asp:Label ID="lblFullName2" runat="server"></asp:Label>
                        </td>
                        <td class="BackGround-gray">
                            Grade
                        </td>
                        <td>
                            <asp:Label ID="lblGrade2" runat="server"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td class="BackGround-gray">
                            Department
                        </td>
                        <td>
                            <asp:Label ID="lblDept2" runat="server"></asp:Label>
                        </td>
                        <td class="BackGround-gray">
                            Position
                        </td>
                        <td>
                            <asp:Label ID="lblPosition2" runat="server"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td class="BackGround-gray">
                            Authority Level
                        </td>
                        <td>
                            <asp:DropDownList ID="dropAuthority" runat="server">
                            </asp:DropDownList>
                        </td>
                        <td class="BackGround-gray">
                            Region Data View
                        </td>
                        <td>
                            <asp:DropDownList ID="dropUserRegion" runat="server">
                                <asp:ListItem Value="00" Text="All"></asp:ListItem>
                                <asp:ListItem Value="01" Text="NORTH"></asp:ListItem>
                                <asp:ListItem Value="02" Text="MIDDLE"></asp:ListItem>
                                <asp:ListItem Value="03" Text="SOUTH"></asp:ListItem>
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4">
                            <input type="button" id="btnClose" onclick="CloseWindow()" style="width: 80px;" class="button Float-right"
                                value="Close" />
                            <asp:Button ID="btnSave" Text="Save" runat="server" Width="80px" 
                                CssClass="button Float-right" onclick="btnSave_Click" />
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
        <div style='padding-top: 10px; text-align: center; display: none' id="imgLoadingabc">
            <img src="../IMAGES/red_loading.gif" />
        </div>
        <div class="Clear_both">
        </div>
    </div>
    </form>
</body>
</html>
